import 'dart:convert';

import 'package:enterprise_v6_app/app/data/common/choice_bean.dart';
import 'package:enterprise_v6_app/generated/json/base/json_field.dart';
import 'package:enterprise_v6_app/generated/json/base_risk_unit_entity.g.dart';
import 'package:get/get_rx/src/rx_types/rx_types.dart';
export 'package:enterprise_v6_app/generated/json/base_risk_unit_entity.g.dart';

/// 隐患排查-分析对象实体类
@JsonSerializable()
class BaseRiskUnitEntity extends ChoiceBean {
  BaseRiskUnitEntity();

  factory BaseRiskUnitEntity.fromJson(Map<String, dynamic> json) => $BaseRiskUnitEntityFromJson(json);
  String? companyCode = '';
  String? coordinate = '';
  String? createBy = '';
  String? createById = '';
  String? createDate = '';
  String? deleted = '';
  String? description = '';
  String? hazardCode = '';
  String? hazardDep = '';
  String? hazardDepId = '';
  String? hazardDistinguishDep = '';
  String? hazardDistinguishDepId = '';
  String? hazardDistinguishPerson = '';
  String? hazardDistinguishPersonId = '';
  String? hazardLiablePerson = '';
  String? hazardLiablePersonId = '';
  String? id = '';
  String? isDistribution = '';
  int? isUpload = 0;
  String? latitude = '';
  int? level = 0;
  String? longitude = '';
  String? riskObjectId = '';

  ///	风险分析单元名称
  String? riskUnitName = '';
  int? status = 0;
  int? taskNum = 0;
  String? updateBy = '';
  String? updateById = '';
  String? updateDate = '';
  String? workType = '';

  @JSONField(deserialize: false, serialize: false)
  RxBool onclick = false.obs;

  Map<String, dynamic> toJson() => $BaseRiskUnitEntityToJson(this);

  @override
  String toString() {
    return jsonEncode(this);
  }

  @override
  String getId() {
    return id!;
  }

  @override
  String getShowName() {
    return riskUnitName!;
  }
}
